package com.xmall.order.define.dict;

import com.xmall.annotation.Dict;

/**
 * 退款类型
 */
@Dict
public enum RefundTypeEnum {

    ONLY_REFUND("仅退款", 0), RETURN("退款退货", 1),
    REPLACE("换货", 2);

    private String name;

    private Integer type;

    RefundTypeEnum(String name, Integer type) {
        this.name = name;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public static String getNameByType(Integer type) {
        for (RefundTypeEnum value : values()) {
            if(value.getType() == type) {
                return value.getName();
            }
        }
        return "";
    }
}
